package com.qfedu.food.controller;

import com.github.pagehelper.PageInfo;
import com.qfedu.food.dto.TFoodDto;
import com.qfedu.food.service.intf.TFtypeService;
import com.qfedu.food.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ftype")
@Api(tags = "实现TFtype各种操作")
public class TFtypeController {

    @Autowired
    private TFtypeService service;
    @ApiOperation(value = "实现查询所有的菜系",notes = "实现查询所有的菜系")
    @GetMapping("/all")
    public R selectTFtypeAll() {
        return R.ok(service.selectTFtypeAll());
    }


    @ApiOperation(value = "实现查询模糊查询以及分页",notes = "实现查询模糊查询以及分页")
    @GetMapping("/ftype")
    public R selectFoodAllPage(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "5") int limit, long id){
        PageInfo<TFoodDto> pageInfo = service.selectAll(page,limit,id);
        return R.ok(pageInfo);
    }


}
